﻿using OpenXml.Internal.IO.Zip;
using OpenXml.IO.Packaging;

namespace OpenXml.Internal.IO.Packaging
{
    public class PieceInfo
    {
        private bool _isLastPiece;
        private string _normalizedPieceNamePrefix;
        private PackUriHelper.ValidatedPartUri _partUri;
        private int _pieceNumber;
        private string _prefixName;
        private ZipFileInfo _zipFileInfo;

        internal PieceInfo(ZipFileInfo zipFileInfo, PackUriHelper.ValidatedPartUri partUri, string prefixName, int pieceNumber, bool isLastPiece)
        {
            this._zipFileInfo = zipFileInfo;
            this._partUri = partUri;
            this._prefixName = prefixName;
            this._pieceNumber = pieceNumber;
            this._isLastPiece = isLastPiece;
            this._normalizedPieceNamePrefix = this._prefixName.ToUpperInvariant();
        }

        internal bool IsLastPiece
        {
            get
            {
                return this._isLastPiece;
            }
        }

        internal string NormalizedPrefixName
        {
            get
            {
                return this._normalizedPieceNamePrefix;
            }
        }

        internal PackUriHelper.ValidatedPartUri PartUri
        {
            get
            {
                return this._partUri;
            }
        }

        internal int PieceNumber
        {
            get
            {
                return this._pieceNumber;
            }
        }

        internal string PrefixName
        {
            get
            {
                return this._prefixName;
            }
        }

        internal ZipFileInfo ZipFileInfo
        {
            get
            {
                return this._zipFileInfo;
            }
        }
    }
}


